﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Shapes;
using System.ComponentModel;
using Signage01.rectangles;

namespace Signage01
{
    [Serializable]
    public class ScreenDivision : INotifyPropertyChanged 
    {
        private string _name;
        /*
        private int _startX;
        private int _startY;
        private int _width;
        private int _height;
        private int _zOrder;
         */ 
        //private Rectangle _rectangle;
        private int _rectangleNumber; // this number relates to the RectangleDraw Object with the corresponding number variable
        private RectangleDiv _rectangleDiv;

        


        public RectangleDiv RectangleDiv
        {
            get 
            { 
                return _rectangleDiv; 
            }
            
            set 
            { 
                _rectangleDiv = value; 
            }
        }

        public int RectangleNumber
        {
            get
            {
                return _rectangleNumber;
            }
            set
            {
                _rectangleNumber = value;
            }
        }




        /*
        public Rectangle Rectangle
        {
            get
            {
                return this._rectangle;
            }
            set
            {
                this._rectangle = value;
            }
        }
        */


        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                this._name = value;
                NotifyPropertyChanged("Name");
            }
        }

        /*
        public int StartX
        {
            get
            {
                return this._startX;
            }
            set
            {
                this._startX = value;
            }
        }
        
        public int StartY
        {
            get
            {
                return this._startY;
            }
            set
            {
                this._startY = value;
            }
        }

        public int Width
        {
            get
            {
                return this._width;
            }
            set
            {
                this._width = value;
            }
        }

        public int Height
        {
            get
            {
                return this._height;
            }
            set
            {
                this._height = value;
            }
        }

        public int ZOrder
        {
            get
            {
                return this._zOrder;
            }
            set
            {
                this._zOrder = value;
            }
        }

         */
        // implement interfact inotifyproperty
        
        private bool isSelected;
        public bool IsSelected
        {
            get { return this.isSelected; }
            set
            {
                if (value != this.isSelected)
                {
                    this.isSelected = value;
                    NotifyPropertyChanged("IsSelected");
                }
            }
        }

        
        private bool isExpanded;
        public bool IsExpanded
        {
            get { return this.isExpanded; }
            set
            {
                if (value != this.isExpanded)
                {
                    this.isExpanded = value;
                    NotifyPropertyChanged("IsExpanded");
                }
            }
        }

        [field:NonSerialized]
        public event PropertyChangedEventHandler PropertyChanged;

        public void NotifyPropertyChanged(string propName)
        {
            if (this.PropertyChanged != null)
                this.PropertyChanged(this, new PropertyChangedEventArgs(propName));
        }
        // end implementation




    }
}
